﻿#if UNITY_EDITOR
using System.Xml.Serialization;
using Unity.Collections;
/// <summary>
/// xlsx表架构
/// </summary>
[XmlRoot("ESF_Xml_XlsxTableSchema")]
public class ESF_Xml_XlsxTableSchema : AbsESF_Xml
{
    /// <summary>
    /// Xlsx文件路径
    /// </summary>
    [XmlElement("Xlsx文件路径")]
    [ESF_GUIBrower()]
    [ReadOnly()]
    public string xlsxFilePath;

    /// <summary>
    /// Xlsx表类型
    /// </summary>
    [XmlElement("Xlsx表类型")]
    [ESF_GUIEnumDefaultValue((int)ESF_enXlsxTableClassify.Normal)]
    public ESF_enXlsxTableClassify xlsxTableClassify;

    /// <summary>
    /// xlsx表索引
    /// </summary>
    [XmlElement("xlsx表索引")]
    [ReadOnly()]
    public int xlsxIndex;

    /// <summary>
    /// xlsx表列架构
    /// </summary>
    [XmlElement("xlsx表列架构")]
    public ESF_Xml_XlsxTableColumnSchema[] columns;
}

/// <summary>
/// xlsx表列架构
/// </summary>
[XmlRoot("ESF_Xml_XlsxTableColumnSchema")]
public class ESF_Xml_XlsxTableColumnSchema
{
    /// <summary>
    /// 列CS名称
    /// </summary>
    [XmlElement("列CS名称")]
    [ReadOnly()]
    [TooltipAppend("isPK", true, "主键")]
    public string csName;
    /// <summary>
    /// 是否忽略
    /// </summary>
    [XmlElement("是否忽略")]    
    public bool isIgnore;
    /// <summary>
    /// 是否主键
    /// </summary>
    [XmlElement("是否主键")]
    public bool isPK;
    /// <summary>
    /// 是否是删除判定
    /// </summary>
    [XmlElement("是否是删除判定")]
    public bool isDelete;
    /// <summary>
    /// 是否可修改
    /// </summary>
    [XmlElement("是否可修改")]
    public bool canModify;
    /// <summary>
    /// 列CS数据类型
    /// </summary>
    [XmlElement("列CS数据类型")]
    [ReadOnly()]
    public ESF_enCS2UnityDataType csDataType;
    /// <summary>
    /// 列SQL名称
    /// </summary>
    [XmlElement("列SQL名称")]
    [ReadOnly()]
    public string sqlName;
    /// <summary>
    /// 列说明
    /// </summary>
    [XmlElement("列说明")]
    [ReadOnly()]
    public string desc;
    /// <summary>
    /// xlsx表列序号
    /// </summary>
    [XmlElement("xlsx表列序号")]
    [ReadOnly()]
    public int xlsxOrdinal;
}
#endif

